import { Example, UseScaffolder, CommunityNote } from '../../components'
import { Link } from '@brillout/docpress'

<CommunityNote url="https://www.fastify.io" />

<UseScaffolder>Fastify</UseScaffolder>

## Example

 - <Example timestamp="2025.01" repo="whyte50/vike-example-fastify" />
 - <Example timestamp="2024.01" repo="royalswe/vike-fastify-boilerplate" />

## HTML Streaming

In general, we recommend using `pageContext.httpResponse.pipe()` for integrating <Link href="/streaming">HTML streaming</Link> to your server, see <Link href="/streaming#basics" />.

But Fastify doesn't seem to expose any writable stream (as far as we know). As a workaround, you can directly use Node.js's writable stream as shown [here](https://github.com/royalswe/vike-fastify-boilerplate/blob/74bf861b98bfc6ab0cdffc5d3483b52c18cf1c14/server/index.ts#L84-L87). If this workaround doesn't work out for you, you can fallback to `pageContext.httpResponse.getReadableNodeStream()`.
